<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <style>
        table {
            margin-top: 40px;
            width: 100%;
            border-collapse: collapse;
            border: 2px solid #333;
        }

        th,
        td {
            padding: 10px;
            text-align: center;
            border-bottom: 1px solid #ddd;
        }

        th {
            background-color: #f2f2f2;
            color: #333;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        tr:nth-child(odd) {
            background-color: #a2cb89;
        }

        tbody tr:nth-child(odd) {
            background-color: #d9d9d9;
        }

        table thead tr td {
            font: 1.5em sans-serif;
        }

        table caption {
            font: 2em sans-serif;
        }
    </style>
</head>
<body>
    <div id="code">
        {{ source_code | safe }}
    </div>
    <table>
        <caption>海南经贸职业技术学院校园新闻表</caption>
        <thead>
            <tr>
                <td>序号</td>
                <td>日期</td>
                <td>标题</td>
                <td>网址</td>
            </tr>
        </thead>
        <tbody id="students">
        </tbody>
    </table>    
    <script>
        // document.querySelector("header").style.display="None";
        $("header").hide();
        $("aside").hide();
        $(".footx").hide();
        $("#divu11").hide();
        $(".fdiv.muc").hide();
        $(".pb_sys_common.pb_sys_full.pb_sys_style1").hide();
        $(".m_new1").hide();

        // 遍历每个 <li> 元素
            $(".m_new1 li").each(function(index) {
            // 获取日期和标题
            var date = $(this).find('cite').text();
            var title = $(this).find('a').text();
            // 获取网址https://www.hceb.edu.cn/
            var url = $(this).find('a').attr('href');
            url ="https://www.hceb.edu.cn/" + url;
            // 填入表格中
            $("#students").append("<tr><td>" + (index + 1) + "</td><td>" + date + "</td><td>" + title + "</td><td><a href='"+url+"'>" + url + "</a></td></tr>");
        });
    </script>
</body>
</html>